'''
Created on Dec 6, 2009

@author: bodnaria
'''

from google.appengine.ext import webapp
from model.TempUser import getUserByKey
from model.TempUser import deleteKey
import appengine_utilities.sessions
from error import UserError

class ValidateLinkPage(webapp.RequestHandler):
    def post(self):
        key = self.request.get("key")
        
        try:
            user = getUserByKey(key)
        except UserError.UserError, e:
            self.redirect('/?error=badHash')
            return
        
        #delete the temp user from the database     
        self.redirect("/create_profile?key="+key)
        return
    
    def get(self):
        self.post()
        
        
        
        
